package com.group4.xiao_ge_lai_yi_zhu.domain;


import com.group4.xiao_ge_lai_yi_zhu.MyException.NumberNotCorrectException;

/**
 * 蓝色球对象类
 */
public class BlueBall {
    private int number;
    private final static String COLOR = "Blue";

    public BlueBall(int number) throws NumberNotCorrectException {
        if (number >= 1 && number <= 16) {
            this.number = number;
        } else {
            throw new NumberNotCorrectException("数字必须在1到16之间(包括1和16)!");
        }
    }

    @Override
    public String toString() {
        return "BlueBall{" + "number="
                + number + ", color="
                + COLOR + '}';
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public static String getCOLOR() {
        return COLOR;
    }
}
